<template>
    <div>
        <SvgIcon @click="changeScreen" icon-class="fullscreen" style="color:#fff; width: 20px; height: 20px"></SvgIcon>
    </div>
</template>

<script>
import SvgIcon from '../SvgIcon'
import ScreenFull from 'screenfull'

export default {
    components: {
        SvgIcon
    },
    methods: {
        changeScreen() {
            if (!ScreenFull.isEnabled) {
                // 此时全屏不可用
                this.$message.warning('此时全屏组件不可用')
                return
            }
            // document.documentElement.requestFullscreen()  原生js调用
            //   如果可用 就可以全屏
            ScreenFull.toggle()
        }
    }
}
</script>

<style>

</style>